package com.proxy.cjlibProxy;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;


public class CglibMethodInterceptor implements MethodInterceptor {
    public CglibMethodInterceptor() {
    }

    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("调用方法前----调用方法=" + method.getName());
        Object o1 = methodProxy.invokeSuper(o, objects);
        System.out.println("调用方法后----调用方法=" + method.getName());
        return o1;
    }
}
